<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>03_模板编译原理</title>
  <script src="./node_modules/vue-template-compiler/browser.js"></script>
</head>
<body>
</body>
<script>

  let { ast,render } = VueTemplateCompiler.compile('<div>{{aaaa}}</div>')
  console.log(ast) // ast 是html字符串转换的Ast语法树
  console.log(render) // render是生成的渲染函数
  console.log(new Function(render).toString())
  // render方法执行完毕后生成的是虚拟dom
  // with(this){return _c('div',[_v(_s(aaaa))])
  // 代码生成
</script>
</html>